import request from '@/utils/request'

// 查询消费记录列表
export function listRecord(query) {
    return request({
        url: '/order/consumption/list',
        method: 'get',
        params: query
    })
}

// 查询消费记录详细
export function getRecord(id) {
    return request({
        url: '/order/consumption/' + id,
        method: 'get'
    })
}

// 新增消费记录
export function addRecord(data) {
    return request({
        url: '/order/consumption',
        method: 'post',
        data: data
    })
}

// 修改消费记录
export function updateRecord(data) {
    return request({
        url: '/order/consumption',
        method: 'put',
        data: data
    })
}

// 删除消费记录
export function delRecord(id) {
    return request({
        url: '/order/consumption/' + id,
        method: 'delete'
    })
}

export function consumptionRefund(data) {
    return request({
        url: '/order/consumption/refund',
        method: 'post',
        data: data
    })
}

export function consumptionflowRefund(data) {
    return request({
        url: '/order/consumption/flowRefund',
        method: 'post',
        data: data
    })
}
export function summary(data) {
    return request({
        url: '/order/consumption/countConsumption',
        method: 'post',
        data: data
    })
}


export function countConsumptionByPerson(data) {
    return request({
        url: '/order/consumption/countConsumptionByPerson',
        method: 'post',
        data: data
    })
}